<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title> 登录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
	
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.min.css" rel="stylesheet">
    <link href="/css/style.min.css" rel="stylesheet">
    <link href="/css/login.min.css" rel="stylesheet">
    <!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script src="/js/jquery.cookie.js"></script>
   	<script src="/common/petecat.js?v=1.0.0"></script>
   	<script src="/js/plugins/layer-pc/layer.js"></script>
    <script>
        if(window.top!==window.self){window.top.location=window.location};
    </script>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row">
            <div class="col-sm-7">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[皮特猫]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用 <strong>互联网渠道平台</strong></h4>
                    <ul class="m-b">
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>快速放款</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>高额佣金</li>
                        <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i>服务细致</li>
                    </ul>
                </div>
            </div>
            <div class="col-sm-5">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到互联网渠道平台</p>
                    <input type="text" id="mobilephone" class="form-control uname" value="13348828865" placeholder="用户名" />
                    <input type="password" id="password" class="form-control pword m-b" value="123456" placeholder="密码" />
                    <a href="">忘记密码了？</a>
                    <button id="loginBtn" class="btn btn-success btn-block">登录</button>
            </div>
        </div>
        <div class="signup-footer">
            <div class="pull-left">
                &copy; 2018 All Rights Reserved. PETE-CAT
            </div>
        </div>
    </div>
	<script type="text/javascript">
	$(function(){
		$('#loginBtn').click(function(){
			var req = {useToken:false};
			req['reqJSON'] = {
				url:  SSO_URL+'sy/sysuser/loginUsePwd',
				type:'get',
				data:{
					mobilephone:$("#mobilephone").val(),
					password:$("#password").val()
				}
			};
			req['successFn'] = function(respData){
					if(respData.code == SUCCESS_CODE){
						storeSessionData('user', JSON.stringify(respData.data));
						storeSessionData('userToken',respData.data.token);
				        //开始加载权限信息
				        var reqInner = {useToken:true};
				        reqInner['reqJSON'] = {
							url:  SSO_URL+'sy/sysuserrole/queryUserFunForLogin',
							type:'get'
						};
				        reqInner['successFn'] = function(respInnerData){
				        	 layer.msg(respInnerData.message, {icon: 6},function(){
				        		 if(respInnerData.code == SUCCESS_CODE){
				        			 storeSessionData('userPower', JSON.stringify(respInnerData.data));
				        			 window.location.href = 'index.html';
				        		 }
							  }); 
				        }
				    	ajaxRequest(reqInner);
						
					}else{
						 layer.msg(respData.message, {icon: 6},function(){
			        	 }); 
					}

				
			};
			ajaxRequest(req);
		});	
	});
	</script>
</body>
</html>